using System.Threading.Tasks;
using JlPay.Sdk.Core;
using JlPay.Sdk.Models.Trans.Mini.Wx;

namespace JlPay.Sdk.Services.Trans.Mini.Wx
{
    /// <summary>
    /// 微信公众号/小程序支付服务
    /// </summary>
    public class OfficialPayService : BaseService
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="config">配置对象</param>
        public OfficialPayService(Config config) : base(config)
        {
        }

        /// <summary>
        /// 微信公众号/小程序支付接口
        /// </summary>
        /// <param name="request">微信公众号/小程序支付请求</param>
        /// <returns>微信公众号/小程序支付响应</returns>
        public async Task<OfficialPayResponse> OfficialPayAsync(OfficialPayRequest request)
        {
            return await PostAsync<OfficialPayRequest, OfficialPayResponse>(request, OfficialPayRequest.API_URL);
        }
    }
} 